package reflect;

import reflect.annotations.AutoRunClass;
/**
 反射机制中访问注解
 */
public class ReflectDemo7 {
    public static void main(String[] args) throws Exception {
        //查看Person类是否有被AutoRunClass标注?
        //1加载类对象
        Class cls = Class.forName("reflect.Person");
        //2判断当前类对象cls表示的类Person是否被指定的注解@AutoRunClass标注了
        boolean tf = cls.isAnnotationPresent(AutoRunClass.class);
        System.out.println("是否被标注了:" + tf);
    }
}
